#ifndef EFFECT_H
#define EFFECT_H

#include <QtOpenGL/QGLContext>
#include <QtOpenGL/QGLShader>
#include <QtOpenGL/QGLShaderProgram>

#include <QtGui/QMessageBox>

#include <QString>
#include <QFile>
#include <QDirIterator>
#include <QDebug>

#include "EffectVariable.h"

class Effect
{
public:
	Effect();
	~Effect();

	void setName(const QString& name);
	const QString& name() const { return m_name; }

	void setGLSLFilename(const QString& filename);
	
	void addVariable(const EffectVariable& var);
	QList<EffectVariable>& variables() { return m_variables; }

	void loadShader(const QGLContext* context);
	QGLShaderProgram* shaderProgram() { return m_program; }

	void setupGuiControls();

	void activate(const QGLContext* glContext);
	void deactivate();

private:
	QString m_name;
	QString m_glslFilename;

	QGLShader* m_pixelShader;
	QGLShaderProgram* m_program;
	
	QList<EffectVariable> m_variables;

	QString loadShaderSource();
};

#endif
